package server.handler.friendHandler;

import com.alibaba.fastjson.JSONObject;
import common.EnvelopeMessage;
import common.bodies.FriendShipBody;
import server.dao.FriendDao;
import server.handler.SimpleHandler;
import server.session.Session;

public class FriendDeleteHandler implements SimpleHandler {
    @Override
    public void handle(EnvelopeMessage msg, Session session) {
        JSONObject body = msg.getBody();
        FriendShipBody ship = body.getObject("friendship",FriendShipBody.class);
        ship.setStatus(-1);
        new FriendDao().updateFriendShip(ship);
    }
}
